#!/bin/sh
echo 'import data from hdfs。。。'
currDate=`date +%Y%m%d`
echo "日期：'$currDate'"
/opt/lagou/servers/hive-2.3.7/bin/hive -e "USE default;INSERT INTO TABLE user_info SELECT COUNT(DISTINCT id) num, TO_DATE(click_time) `date` FROM user_clicks WHERE TO_DATE(click_time) = '$currDate' GROUP BY TO_DATE(click_time);"